window.onload=function(){
    var config = {
        elem:"#user",
        url:"/hot-word/user-index",
        cols:[[
            {field:'id', width:105, title: '编号'},
            {field:'word', minWidth:105, title: '热词'},
            {field:'type', minWidth:105, title: '来源',templet:function(i){
                    switch (parseInt(i.type)){
                        case 1: return 'B端用户';
                        default: return 'C端用户';
                    }
                }},
            {field:'search_times', minWidth:105, title: '搜索次数'},
            {field:'create_time', minWidth:150, title: '添加时间',templet:function(i){
                    return timestampToTime(parseInt(i.create_time));
                }},
            {field:'update_time', minWidth:150, title: '最后修改时间',templet:function(i){
                    return timestampToTime(parseInt(i.update_time));
                }}
        ]],
        page:true
    };

    layui.use(['jquery','table'],function(){
        var $ = layui.jquery, table = layui.table;

        table.render(config);
    })
};